協作-使用 Pull Request (PR)


Posted by mijouhsieh on 2023-07-02

重點:

  • 和夥伴協作時,該如何把自己修改的部分,上傳給夥伴的 GitHub
  • 練習寫清楚的commit

  1. 在夥伴GitHub專案頁面選Fork按鈕,會在自己的GitHub上看到fork的專案(顯示來自夥伴帳號)
    pull-request-fork-github

  2. clone fork來的專案

  3. 修改後在Sourcetree上做commit

參考 ### Commit Message 規範
包含header、body、footer三部分
header有 type、scope、subject。
type 有限制類別
body-說明coding變異原因

type 只允許使用以下類別:

feat: 新增/修改功能 (feature)。
fix: 修補 bug (bug fix)。
docs: 文件 (documentation)。
style: 格式 (不影響程式碼運行的變動 white-space, formatting, missing semi colons, etc)。
refactor: 重構 (既不是新增功能,也不是修補 bug 的程式碼變動)。
perf: 改善效能 (A code change that improves performance)。
test: 增加測試 (when adding missing tests)。
chore: 建構程序或輔助工具的變動 (maintain)。
revert: 撤銷回覆先前的 commit 例如:revert: type(scope): subject (回覆版本:xxxx)。

  1. 修改一個階段後,再 git push 上傳
  2. 發 PR 給夥伴
    pull-request-BTN-github

  3. 寫PR的內容
    pull-request-WRITE-github

  4. 送出PR後的畫面
    pull-request-DONE-github


之後再修改重複 3, 4的步驟,仍匯出先在同一支PR上。


#Pull Request #commit message







Related Posts

陳述式 與 表達式

陳述式 與 表達式

CH3. 初探頭等函式 : 定義與引數

CH3. 初探頭等函式 : 定義與引數

ASP.NET Core Web API 入門教學 - 同時取得父子資料

ASP.NET Core Web API 入門教學 - 同時取得父子資料


Comments